package com.example.workshop.lesson7;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class RecommenderImplementation2 {
    private Filter filter;
    @Autowired
    @Qualifier("collaborativeFilter")
     public void setFilter(Filter filter){

         this.filter=filter;

        System.out.println("setter method invoked...");

    }
     public String[] recommendMovies(String Movie){
        //打印正在使用的过滤器
         System.out.println("\n正在使用的过滤器是"+filter+"\n");

         String results[]=filter.getRecommendations("流浪地球");

         return results;
     }
}
